package com.caishi.lkx.user.userlog.vo;

import com.caishi.lkx.user.userlog.model.Count;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;


@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Schema(title = "机构统计行数据")
public class TableRow {

    @Schema(title = "访问量")
    private Count accessLog;

    @Schema(title = "使用人次")
    private Count useLog;

    @Schema(title = "试卷使用量")
    private Count paperUseLog;

    @Schema(title = "试题使用量")
    private Count questionUseLog;

    @Schema(title = "新增注册数")
    private Count registerLogNew;

    @Schema(title = "总注册数")
    private Count registerLog;

    @Schema(title = "使用时长")
    private Count timeUseLog;

    @Schema(title = "平均使用时长")
    private Count timeUseLogAvg;

    @Schema(title = "下载次数")
    private Count downloadLog;

    public ClientTableRow toClient() {
        var client = new ClientTableRow();
        client.setAccessLog(accessLog.toClient());
        client.setUseLog(useLog.toClient());
        client.setPaperUseLog(paperUseLog.toClient());
        client.setQuestionUseLog(questionUseLog.toClient());
        client.setRegisterLogNew(registerLogNew.toClient());
        client.setRegisterLog(registerLog.toClient());
        client.setTimeUseLog(timeUseLog.toClient());
        client.setTimeUseLogAvg(timeUseLogAvg.toClient());
        client.setDownloadLog(downloadLog.toClient());
        return client;
    }
}
